<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


    <style type="text/css">
        .div-item{
            width: 100px;
            height: 100px;
        }
        #red_div{
            background-color: red;
        }
        #green_div{
            background-color: green;
            position: absolute;
            top: 82px;
            left: 17px;

        }
        #yellow_div{
            background-color: yellow;
            position: absolute;
            top: 22px;
            left: 40px;
        }
        #parent{
            margin-top: 100px;
            position: relative;
            width: 200px;
            height: 250px;
        }

        #top{
            width: 700px;
            height: 400px;
            background-image: url("./demo.jpg");
            position: relative;
        }
        #top::before {
            color: white;
            font-size: 40px;
            content: "This is background";
            position: absolute;
            top: 110px;
            left: 115px;
            width: 100%;
            height: 100%;
            z-index: 1;
        }
        #bottom{
            width: 700px;
            height: 400px;
            background-image: url("./demo.jpg");
            position: relative;
        }
        #bottom::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.5); /* 黑色背景，透明度为50% */
            z-index: 1;
            display: none;
        }
        #bottom:hover::before{
            display: block;
        }

    </style>
</head>
<body>


    <div id="top" > </div>

    <div id="parent">
        <div class="div-item" id="red_div">

        </div>
        <div class="div-item" id="green_div">

        </div>
        <div class="div-item" id="yellow_div">

        </div>
    </div>

    <div id="bottom"> </div>

</body>


</html>